import request from '@/config/axios'

// noinspection TypeScriptUnresolvedReference
export interface ArtCategoryVO {
  id: number
  name: string
  status: byte
  parentId: number
  url: string
  seoKeywords: string
  seoTitle: string
  seoDescription: string
  typeName: string
  siteurl: string
  sort: number
}

export const getSimpleCateList = async (): Promise<ArtCategoryVO[]> => {
  return await request.get({ url: '/cms/art-category/list-all-simple' })
}
// 查询文章分类列表
export const getArtCategoryPage = async (params) => {
  return await request.get({ url: `/cms/art-category/page`, params })
}

// 查询文章分类详情
export const getArtCategory = async (id: number) => {
  return await request.get({ url: `/cms/art-category/get?id=` + id })
}

// 新增文章分类
export const createArtCategory = async (data: ArtCategoryVO) => {
  return await request.post({ url: `/cms/art-category/create`, data })
}

// 修改文章分类
export const updateArtCategory = async (data: ArtCategoryVO) => {
  return await request.put({ url: `/cms/art-category/update`, data })
}

// 删除文章分类
export const deleteArtCategory = async (id: number) => {
  return await request.delete({ url: `/cms/art-category/delete?id=` + id })
}

// 导出文章分类 Excel
export const exportArtCategory = async (params) => {
  return await request.download({ url: `/cms/art-category/export-excel`, params })
}
